﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Admin_ExpertAnswerOffLineQuestion : PX.ShowLayer.BaseView
{
	private PX.Question.View clsQuestionView = new PX.Question.View();

	/// <summary>
	/// 回答问题按钮
	/// </summary>
	private LinkButton lBtnAnswer = new LinkButton();
	/// <summary>
	/// 专家控制类
	/// </summary>
	private PX.Expert.ExpertComponent clsExpertComp = new PX.Expert.ExpertComponent();

	public Admin_ExpertAnswerOffLineQuestion()
		: base("idTotal")
	{
		clsView = clsQuestionView;

		lBtnShowAdd.Visible = false;
		//lBtnEdit.Visible = false;
		lBtnDelete.Visible = false;
		

		lBtnAnswer.ID = "201406161114";
		lBtnAnswer.CommandName = "201406161115";
		lBtnAnswer.Text = "回答";

		//AddGridViewOperation(lBtnAnswer);

		AddTableColumn(new Tony.Structs.TableShowColumn("姓名", "AskerName"));
		AddTableColumn(new Tony.Structs.TableShowColumn("电子邮箱", "AskerEMail"));
		AddTableColumn(new Tony.Structs.TableShowColumn("联系电话", "AskerPhone"));
		AddTableColumn(new Tony.Structs.TableShowColumn("问题", "Content"));


	}

	protected override void OnInit(EventArgs e)
	{
		base.OnInit(e);

		lBtnEdit.Text = "回答";
	}

	protected void Page_Load(object sender, EventArgs e)
	{
		clsQuestionView.nExpertID = clsExpertComp.QueryOne(Convert.ToInt32(Session["LoginUserID"])).ID;
	}


	protected override void SetFloatSecondAddEdit(Panel pSecond)
	{
		//base.SetFloatSecondAddEdit(pSecond);
		clsQuestionView.AnswerQuestionLayout(pSecond);
	}

	protected override void BindGridViewNoQuery(GridView gv)
	{
		//base.BindGridViewNoQuery(gv);
		clsQuestionView.QueryNoAnswerOffLineQuestion(gvTable);
	}

	protected override void ShowEdit()
	{
		//base.ShowEdit();
		if (pAddEdit.Controls.Count > 0)
		{
			int nEditID;

			ViewState["Status"] = "Edit";
			nEditID = Convert.ToInt32(ViewState["ID"]);

			mvViews.SetActiveView(vAddEdit);
			ShowFloat();
			labFloatTitle.Text = "回答";

			//clsView.ShowEdit();
			clsQuestionView.ShowAnswerQuestion();

			Edit(nEditID);
		}
	}

}
